<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>CSS样式优先级</title>
		
		
		<style>
			p{
				color: red;
			}
			.txt{
				background-color: yellow;
			}
			.txt{
				background-color: green;
			}
			/* -------------------- */
			
			
		</style>
	</head>
	<body>
		
		<div>
			<p class="txt"> 测试文字</p>
			
		</div>
		<hr>
		<p>
			<span>测试文字2</span>
		</p>
		
		
		
	</body>
</html>